<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" indent="yes"/><!-- Genera el menu del website -->
  <xsl:template match="Navigation">
    <xsl:for-each select="item">
      <xsl:call-template name="SubMenu">
      </xsl:call-template>
    </xsl:for-each>
  </xsl:template>
  
  <xsl:template match="SideNavigation">
    <xsl:for-each select="item">
      <xsl:call-template name="SubMenu2">
      </xsl:call-template>
    </xsl:for-each>
  </xsl:template>
  
  <xsl:template match="FootNavigation">
    <xsl:for-each select="item">
      <xsl:call-template name="SubMenu2">
      </xsl:call-template>
    </xsl:for-each>
  </xsl:template>
  
  <xsl:template match="StoreNavigation">
    <xsl:for-each select="item">
      <xsl:call-template name="SubMenu">
      </xsl:call-template>
    </xsl:for-each>
  </xsl:template>
  
  
  <xsl:template name="SubMenu">
    <xsl:variable name="strURL" select="@link" />
    <xsl:variable name="id" select="@id" />
    <xsl:variable name="order" select="@order" />
    <xsl:if test="count(item) &gt; 0">
      <li id="{$id}"><a href="{$strURL}" rel="{$order}">
      <span>
      <xsl:value-of select="caption" /></span></a>
        <ul id="{$id}-hijos" class="menuChildNode">
          <xsl:for-each select="item">
            <xsl:call-template name="SubMenu">
            </xsl:call-template>
          </xsl:for-each>
        </ul>
      </li>
    </xsl:if>
    <xsl:if test="count(item) = 0">
      <li id="{$id}">
      <a href="{$strURL}"  rel="{$order}"><span>
      <xsl:value-of select="caption" /></span></a></li>
    </xsl:if>
  </xsl:template>
  
   <xsl:template name="SubMenu2">
    <xsl:variable name="strURL" select="@link" />
    <xsl:variable name="id" select="@id" />
    <xsl:variable name="order" select="@order" />
    <xsl:if test="count(item) &gt; 0">
      <li id="{$id}"><a href="{$strURL}" rel="{$order}">
      <span>
      <xsl:value-of select="caption" /></span></a>
       
      </li>
    </xsl:if>
    <xsl:if test="count(item) = 0">
      <li id="{$id}">
      <a href="{$strURL}"  rel="{$order}"><span>
      <xsl:value-of select="caption" /></span></a></li>
    </xsl:if>
  </xsl:template>
</xsl:stylesheet>